package com.platform.config;

import com.platform.annotation.resolver.CurrentUserResolver;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.method.support.HandlerMethodArgumentResolver;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

import java.util.List;

/**
 * 注入解析器，使用方式如果该服务需要使用自定义注解获取用户信息，需要在此处注入解析器。
 * @author guoyunpeng
 * @version 1.0
 * @date 2022-02-26 19:57
 */
@Configuration
public class ResolverConfig implements WebMvcConfigurer {

    @Override
    public void addArgumentResolvers(List<HandlerMethodArgumentResolver> resolvers) {
        resolvers.add(new CurrentUserResolver());
    }
}
